import 'package:qianyi/network/http_manager.dart';

class TrendEntityList {
  TrendEntityList({
    this.trends,
    this.currentPage,
    this.pageSize,
    this.totalTrends,
    this.hasNextPage,
  });

  List<TrendEntity>? trends;
  int? currentPage;
  int? pageSize;
  int? totalTrends;
  bool? hasNextPage;
  TrendEntityList.fromJson2(Map<String, dynamic> json) {
    if (json['data'] != null) {
      trends = <TrendEntity>[];
      json['data']['records'].forEach((v) {
        trends!.add(TrendEntity.fromJson(v));
      });

    }

  }
  TrendEntityList.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      trends = <TrendEntity>[];
      json['data'].forEach((v) {
        trends!.add(TrendEntity.fromJson(v));
      });

    }

  }
  getImageIds() {
    List<String>  mids = trends!.map((e) => e.mid!).toList();
    return mids;
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (trends != null) {
      data['trends'] = trends!.map((v) => v.toJson()).toList();
    }
    data['currentPage'] = currentPage;
    data['pageSize'] = pageSize;
    data['totalTrends'] = totalTrends;
    data['hasNextPage'] = hasNextPage;
    return data;
  }
}
class TrendEntity {
  TrendEntity({
    this.mid,
    this.userId,
    this.username,
    this.avatar,
    this.content,
    this.imgsUrl,
    this.albumId,
    this.albumName,
    this.agreeCount,
    this.commentCount,
    this.isAgree,
    this.status,
    this.time,
  });

  TrendEntity.fromJson(Map<String, dynamic> json) {
    mid = json['mid'];
    userId = json['userId'];
    username = json['username'];
    avatar = json['avatar'];
    content = json['content'];
    imgsUrl = json['imgsUrl'];
    albumId = json['albumId'];
    albumName = json['albumName'];
    agreeCount = json['agreeCount'];
    commentCount = json['commentCount'];
    isAgree = json['isAgree'];
    status = json['status'];
    time = json['time']; // Assuming time is a String in ISO8601 format
  }

  String? mid;
  String? userId;
  String? username;
  String? avatar;
  String? content;
  String? imgsUrl;
  String? albumId;
  String? albumName;
  String? agreeCount;
  String? commentCount;
  bool? isAgree;
  int? status;
  int? time; // Assuming time is a String in ISO8601 format
  String? cover;
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['mid'] = this.mid;
    data['userId'] = this.userId;
    data['username'] = this.username;
    data['avatar'] = this.avatar;
    data['content'] = this.content;
    data['imgsUrl'] = this.imgsUrl;
    data['albumId'] = this.albumId;
    data['albumName'] = this.albumName;
    data['agreeCount'] = this.agreeCount;
    data['commentCount'] = this.commentCount;
    data['isAgree'] = this.isAgree;
    data['status'] = this.status;
    data['time'] = this.time;
    data['cover'] = this.cover;
    return data;
  }
}
